<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>ListPlan</title>
<link rel="stylesheet" type="text/css" href="../css/tablesorter/style.css"/>
<script type="text/javascript" src="../script/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../script/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="../script/jquery.tablesorter.pager.js"></script>
<script type="text/javascript">
    $(document).ready(function() {
        
    	getPlanData({"pageIndex": "1", "pageSize": "10", "scztCode": "2"});

    	$("#searchButton").click(function() {
        	if ($("#searchNameId").val() == "") {
            	return ;
        	} else {
            	var strArr = new Array();
            	strArr.push('{');
            	strArr.push('"pageIndex": "1", "pageSize": "10", "scztCode": "2"');
            	strArr.push(', "searchName": ' + $("#searchNameId").val());
            	strArr.push(', "searchContent": ' + $("#searchContentId").val());
            	strArr.push('}');
        		getPlanData(eval(strArr.join('')));
            }
    	});
    });

    function getPlanData(condition) {
    	$.getJSON("ListPlan.action", condition,
            function(data) {
                for (var i = 0; i < data.planList.length; i++) {
                    var strArr = new Array();
                    strArr.push('<tr>');
                    strArr.push('<td>' + data.planList[i].registerid + '</td>');//项目登记号
                    strArr.push('<td>' + data.planList[i].prjUnit + '</td>');//项目单位
                    strArr.push('<td>' + data.planList[i].prjName + '</td>');//项目名称
                    strArr.push('<td>' + data.planList[i].prjXmxzName + '</td>');//项目性质
                    strArr.push('<td>' + data.planList[i].prjXmgm + '</td>');//项目规模
                    strArr.push('<td>' + data.planList[i].prjKzName + '</td>');//矿种
                    strArr.push('<td>' + data.planList[i].prjScztName + '</td>');//审查状态 
                    strArr.push('<td>' + data.planList[i].prjPsjgName + '</td>');//评审结果 
                    strArr.push('<td>' + '<a href="PlanDetailPre.action?planId=' + data.planList[i].prjPkid + '" target="MainFrame">明细</a> ');
                    strArr.push('<a href="#" target="MainFrame">修改</a> <a href="#" target="MainFrame">删除</a> <a href="#" target="MainFrame">返修</a>' + '</td>');//操作
                    strArr.push('</tr>');
                    $("#planDataBody").append(strArr.join(''));
                }
                $("#planDataTable").tablesorter({widthFixed: true, widgets: ['zebra']}).tablesorterPager({container: $("#pager")});
            }
        );
    }
</script>
</head>
<body>
<div style="margin-top: 0px; padding-left: 10px; margin-bottom: 10px">
    <select name="searchName" id="searchNameId">
        <option value="">查询条件</option>
        <option value="Q_XMDW">项目名称</option>
        <option value="Q_XMDW">项目单位</option>
        <option value="Q_XMXZ">项目性质</option>
        <option value="Q_KZ">矿种</option>
    </select>
    <input type="text" id="searchContentId" name="searchContent" /><input type="button" value="查询" id="searchButton" />
</div>
<table id="planDataTable" class="tablesorter" style="margin-top: 0px" width="98%" align="center" cellpadding="2" cellspacing="2">
    <thead>
        <tr>
            <th width="10%">项目登记号</th>
            <th width="12%">项目单位</th>
            <th width="12%">项目名称</th>
            <th width="10%">项目性质</th>
            <th width="10%">项目规模</th>
            <th width="8%">矿种</th>
            <th width="10%">审查状态</th>
            <th width="10%">评审结果</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody id="planDataBody">
    </tbody>
</table>
<div id="pager" class="pager">
     <img src="../css/addons/pager/icons/first.png" class="first"/>
     <img src="../css/addons/pager/icons/prev.png" class="prev"/>
     <input type="text" class="pagedisplay"/>
     <img src="../css/addons/pager/icons/next.png" class="next"/>
     <img src="../css/addons/pager/icons/last.png" class="last"/>
     <select class="pagesize">
         <option selected="selected"  value="10">10</option>
         <option value="20">20</option>
         <option value="30">30</option>
         <option value="40">40</option>
     </select>
</div>
</body>
</html>